package com.z.kq.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.z.kq.entity.ScheSign;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 班制打卡时间Mapper接口
 *
 * @author z
 * @date 2023-03-24
 */
@Mapper
public interface ScheSignMapper extends BaseMapper<ScheSign> {
    /**
     * 查询班制打卡时间列表
     *
     * @param scheSign 班制打卡时间
     * @return 班制打卡时间集合
     */
    List<ScheSign> selectScheSignList(ScheSign scheSign);

    /**
     * 根据班制类型查询班制名称
     * @param scheType
     * @return
     */
    @Select("SELECT DISTINCT sche_name FROM t_sche_sign where sche_type=#{scheType} and unit_id=#{unitId}")
    List<String> selectScheNames(@Param("scheType") String scheType, @Param("unitId")String unitId);

    /**
     *
     * 根据班制名称查询班段名称
     * @param scheName
     * @param scheType
     * @param unitId
     * @return
     */
    @Select("SELECT DISTINCT sche_stage FROM t_sche_sign where sche_name=#{scheName} and sche_type=#{scheType} and unit_id=#{unitId}")
    List<String> selectScheStages( @Param("scheName")String scheName, @Param("scheType") String scheType, @Param("unitId")String unitId);
}
